#include<stdio.h>//Gooddio 指 “Goodandard input & output"（标准输入输出）(常用的函数如fopen(struct Node1* head)、fflush(struct Node1* head)、fwrite(struct Node1* head)、scanf(struct Node1* head)、fscanf(struct Node1* head)、fprintf(struct Node1* head)、sprintf(struct Node1* head)、perror(struct Node1* head))
#include<string.h>//定义了一个变量类型、一个宏和各种操作字符数组的函数（常用的函数如Goodrcpy(struct Node1* head)、Goodrcat(struct Node1* head)、Goodrchr(struct Node1* head)、Goodrcmp(struct Node1* head)、Goodrlen(struct Node1* head)、Goodrcspn(struct Node1* head)、Goodrdup(struct Node1* head)、Goodrerror(struct Node1* head)、Goodrncmp(struct Node1* head)）
#include<stdlib.h>//定义了五种类型、一些宏和通用工具函数(常用的函数如malloc(struct Node1* head)、calloc(struct Node1* head)、realloc(struct Node1* head)、free(struct Node1* head)、syGoodem(struct Node1* head)、atoi(struct Node1* head)、atol(struct Node1* head)、rand(struct Node1* head)、srand(struct Node1* head)、exit(struct Node1* head))

#pragma warning (disable:4996) //消除警告(关闭VS2010的安全警告， 因为VS2020是C++软件)

#define N 200//定义标识符 N为200
typedef struct GYSGL
{	
	char ID[20];
	char Name[20];
	char jiancheng[10];
	char dizhi[20];
	int  phone;
	char youjian[20];
	char lianxiren[20];
	long int telephone;
	char beizhu[20];	
}GYSGL;
typedef struct Node1
{
	struct GYSGL gysgl;
	struct Node1* next;
}Node1;
typedef struct SPGL
{
	char ID[20];
	char Name[20];
	float danjia;
	char gysbh [20];
	char jianjie[50];
	char beizhu[20];	
}SPGL; 
 typedef struct Node2
{
 	struct SPGL spgl;
 	struct Node2* next;
}Node2;
typedef struct YGGL
{
 	char ID[20];
 	char Name[20];
 	char Mima[20];
 	char jibie[10];
 	long int phone;
 	float gongzi;
 	char beizhu[20];
}YGGL;
typedef struct Node3
{
 	struct YGGL yggl;
 	struct Node3* next;
}Node3;
typedef struct CGGL//采购管理结构体
 {
 	char cgqdh[20];//采购清单号
 	char ygbm[20];//员工编码
 	int shuliang;//采购数量
 	float zongjia;//采购总价
 	char time[20];//采购时间
 	char beizhu[20];//采购备注
 }CGGL;
typedef struct Node4
 {
 	struct CGGL cggl;
 	struct Node4* next;
 }Node4;
void Save(struct Node1* head);//供应商信息保存函数
void Read(struct Node1* head);//供应商信息读取函数
void Input(struct Node1* head);//供应商信息输入函数
void All(struct Node1* head);//供应商信息浏览函数
void Que(struct Node1* head);//供应商信息查找函数
void Mod(struct Node1* head);//供应商信息修改函数
void Del(struct Node1* head);//供应商信息删除函数

void Save2(struct Node2* head2);//商品信息保存函数
void Read2(struct Node2* head2);//商品信息读取函数
void Input2(struct Node2* head2);//商品信息输入函数
void All2(struct Node2* head2);//商品信息浏览函数
void Que2(struct Node2* head2);//商品信息查找函数
void Mod2(struct Node2* head2);//商品信息修改函数
void Del2(struct Node2* head2);//商品信息删除函数

void Save3(struct Node3* head3);//员工信息保存函数
void Read3(struct Node3* head3);//员工信息读取函数
void Input3(struct Node3* head3);//员工信息输入函数
void All3(struct Node3* head3);//员工信息浏览函数
void Que3(struct Node3* head3);//员工信息查找函数
void Mod3(struct Node3* head3);//员工信息修改函数
void Del3(struct Node3* head3);//员工信息删除函数

void Save4(struct Node4* head4);//采购信息保存函数
void Read4(struct Node4* head4);//采购信息读取函数
void Input4(struct Node4* head4);//采购信息输入函数
void All4(struct Node4* head4);//采购信息浏览函数
void Que4(struct Node4* head4);//采购信息查找函数
void Mod4(struct Node4* head4);//采购信息修改函数
void Del4(struct Node4* head4);//采购信息删除函数

int main1(struct Node1* head, struct Node2* head2,struct Node3* head3,struct Node4* head4);//管理员函数
int main2(struct Node2* head2, struct Node3* head3,struct Node4* head4);//用户函数
int main12(struct Node1* head);//供应商函数
int main13(struct Node2* head2);//商品函数
int main14(struct Node3* head3);//员工函数
int main15(struct Node4* head4);//采购函数
int main()
{
	struct Node1* head= (struct Node1*)malloc(sizeof(struct Node1));
	struct Node2* head2= (struct Node2*)malloc(sizeof(struct Node2));
	struct Node3* head3= (struct Node3*)malloc(sizeof(struct Node3));
	struct Node4* head4= (struct Node4*)malloc(sizeof(struct Node4));
	head->next=NULL;
	head2->next=NULL;
	head3->next=NULL;
	head4->next=NULL;
	
	Read(head);//读取
	Read2(head2);//读取
	Read3(head3);
	Read4(head4);
	int n = 1;
	while (n != 0)//死循环
	{
		printf("欢迎超市管理系统：\n");
		printf("**************************************\n");
		printf("* 请选择身份操作序号：               *\n");
		printf("* 1 管理员                           *\n");
		printf("* 2 普通用户                         *\n");
		printf("* 0 退出系统                         *\n");
		printf("**************************************\n");
		printf("请选择：");
		scanf("%d", &n);
		system("cls");
		switch (n)//选择
		{
		case 0:
			return 0;
		case 1:	
			main1(head, head2,head3,head4);//管理员函数
			break;
		case 2:
			main2(head2,head3,head4);//用户函数
			break;
		default:
			printf("输入错误， 按任意键返回主菜单");
			break;
		}
		printf("\n");
		system("pause");
		system("cls");
	}
	return 0;//返回值为0
}
int main1(struct Node1* head, struct Node2* head2,struct Node3* head3,struct Node4* head4)//管理员用户函数
{
	int n = 1;
	while (n != 0)//死循环
	{
		printf("----尊敬的管理员用户，你好！          ----：\n");
		printf("********************************************\n");
		printf("***请选择您的操作序号：                  ***\n");
		printf("***1  供应商管理                         ***\n");
		printf("***2  商品管理                           ***\n");
		printf("***3  员工管理                           ***\n");
		printf("***4  采购管理                           ***\n");
		printf("***0  返回上一页                         ***\n");
		printf("********************************************\n");
		printf("请选择：");
		scanf("%d", &n);
		system("cls");
		switch (n)//选择
		{
		case 0:
			return 0;
		case 1:
			main12(head);//供应商函数
			break;
		case 2:
			main13(head2);//商品函数
			break;
		case 3:
			main14(head3);//员工函数
		case 4:
			main15(head4);//采购函数
		default:
			printf("输入错误， 按任意键返回主菜单");
			break;
		}
		printf("\n");
		system("pause");
		system("cls");
	}
	return 0;//返回值为0
}

int main2(struct Node2* head2, struct Node3* head3,struct Node4* head4)
{
	struct Node3* temp2 = (struct Node3*)malloc(sizeof(struct Node3));
	struct Node3* temp_p2 = head3->next ;
	int i = 0, j = 0, k = 0;
	printf("请输入账号：");
	scanf("%s", temp2->yggl.ID );
	printf("请输入密码：");
	scanf("%s", temp2->yggl.Mima );
	if (head3 != NULL)
	{
		while (temp_p2 != NULL)
		{
			if ((strcmp(temp_p2->yggl.ID , temp2->yggl.ID ) == 0) && (strcmp(temp_p2->yggl.Mima , temp2->yggl.Mima ) == 0))
			{
				k = 1;
				
				printf("登录成功！");
				Read3(head3);//读取员工信息文件
				printf("\n");
				system("pause");
				system("cls");
				while (1) {

					int n = 0;
					printf("您好， %s用户：\n",temp_p2->yggl.Name  );
					printf("******************************************\n");
					printf("*** 请择操作序号：                     ***\n");
					printf("*** 1 --查询个人员工信息               ***\n");
					printf("*** 2 --查询所有商品信息               ***\n");
					printf("*** 3 --查询所有的采购信息             ***\n");
					printf("*** 0 --退出登录                       ***\n");
					printf("******************************************\n");
					printf("请选择：");
					scanf("%d", &n);
					system("cls");
					switch (n)//选择
					{
					case 0:
						return 0;
					case 1:
						All3(head3);//显示员工信息
						break;
					case 2:
						All2(head2);//显示所有商品信息
						break;
					case 3:
						All4(head4);//显示所有采购信息
						break;					
					default:
						printf("输入错误， 按任意键返回主菜单");
						break;
					}
					Save3(head3);
					Save2(head2);
					Save4(head4);
					printf("\n");
					system("pause");
					system("cls");
				}

			}
			temp_p2 = temp_p2->next;

		}
	}
	if (k != 1)
	{
		printf("账号或密码错误！");
		return 0;
	}
	else 
	{
		
	}
	return 0;
}

int main12(struct Node1* head)//供应商函数
{
	int n = 1;
	while (n != 0)//死循环
	{
		printf("供应商信息管理子系统：\n");
		printf("**********************************\n");
		printf("* 请择操作序号：                 *\n");
		printf("* 1 输入供应商信息               *\n");
		printf("* 2 输出供应商信息               *\n");
		printf("* 3 查询供应商信息               *\n");
		printf("* 4 修改供应商信息               *\n");
		printf("* 5 删除供应商信息               *\n");
		printf("* 0 返回上一页                   *\n");
		printf("**********************************\n");
		printf("请选择：");
		scanf("%d", &n);
		system("cls");
		switch (n)//选择
		{
		case 0:
			return 0;
		case 1:
			Input(head);//添加或增加供应商信息
			break;
		case 2:
			All(head);//显示全部供应商信息
			break;
		case 3:
			Que(head);//供应商信息查找函数
			break;
		case 4:
			Mod(head);//供应商信息修改函数
			break;
		case 5:
			Del(head);//供应商信息删除函数
			break;
		default:
			printf("输入错误， 按任意键返回主菜单");
			break;
		}
		Save(head);

		printf("\n");
		system("pause");
		system("cls");

	}
	return 0;//返回值为0
}
int main13(struct Node2* head2)//商品函数
{
	int n = 1;
	while (n != 0)//死循环
	{
		printf("商品信息管理子系统：\n");
		printf("**********************************\n");
		printf("* 请择操作序号：                 *\n");
		printf("* 1 输入商品信息               *\n");
		printf("* 2 输出商品信息               *\n");
		printf("* 3 查询商品信息               *\n");
		printf("* 4 修改商品信息               *\n");
		printf("* 5 删除商品信息               *\n");
		printf("* 0 返回上一页                   *\n");
		printf("**********************************\n");
		printf("请选择：");
		scanf("%d", &n);
		system("cls");
		switch (n)//选择
		{
		case 0:
			return 0;
		case 1:
			Input2(head2);//添加或增加供应商信息
			break;
		case 2:
			All2(head2);//显示全部商品信息
			break;
		case 3:
			Que2(head2);//商品信息查找函数
			break;
		case 4:
			Mod2(head2);//商品信息修改函数
			break;
		case 5:
			Del2(head2);//商品信息删除函数
			break;
		default:
			printf("输入错误， 按任意键返回主菜单");
			break;
		}
		Save2(head2);

		printf("\n");
		system("pause");
		system("cls");

	}
	return 0;//返回值为0
}
int main14(struct Node3* head3)//员工函数
{
	int n = 1;
	while (n != 0)//死循环
	{
		printf("员工信息管理子系统：\n");
		printf("**********************************\n");
		printf("* 请择操作序号：                 *\n");
		printf("* 1 输入员工信息                 *\n");
		printf("* 2 输出员工信息                 *\n");
		printf("* 3 查询员工信息                 *\n");
		printf("* 4 修改员工信息                 *\n");
		printf("* 5 删除员工信息                 *\n");
		printf("* 0 返回上一页                   *\n");
		printf("**********************************\n");
		printf("请选择：");
		scanf("%d", &n);
		system("cls");
		switch (n)//选择
		{
		case 0:
			return 0;
		case 1:
			Input3(head3);//添加或增加员工信息
			break;
		case 2:
			All3(head3);//显示全部员工信息
			break;
		case 3:
			Que3(head3);//员工信息查找函数
			break;
		case 4:
			Mod3(head3);//员工信息修改函数
			break;
		case 5:
			Del3(head3);//员工信息删除函数
			break;
		default:
			printf("输入错误， 按任意键返回主菜单");
			break;
		}
		Save3(head3);

		printf("\n");
		system("pause");
		system("cls");

	}
	return 0;//返回值为0
}
int main15(struct Node4* head4)//采购函数
{
	int n = 1;
	while (n != 0)//死循环
	{
		printf("采购信息管理子系统：\n");
		printf("**********************************\n");
		printf("* 请择操作序号：                 *\n");
		printf("* 1 输入采购信息               *\n");
		printf("* 2 输出采购信息               *\n");
		printf("* 3 查询采购信息               *\n");
		printf("* 4 修改采购信息               *\n");
		printf("* 5 删除采购信息               *\n");
		printf("* 0 返回上一页                   *\n");
		printf("**********************************\n");
		printf("请选择：");
		scanf("%d", &n);
		system("cls");
		switch (n)//选择
		{
		case 0:
			return 0;
		case 1:
			Input4(head4);//添加或增加采购信息
			break;
		case 2:
			All4(head4);//显示全部采购信息
			break;
		case 3:
			Que4(head4);//采购信息查找函数
			break;
		case 4:
			Mod4(head4);//采购信息修改函数
			break;
		case 5:
			Del4(head4);//采购信息删除函数
			break;
		default:
			printf("输入错误， 按任意键返回主菜单");
			break;
		}
		Save4(head4);

		printf("\n");
		system("pause");
		system("cls");

	}
	return 0;//返回值为0
}
void Save(struct Node1* head) //保存供应商信息
{
	int i = 0, j = 0, k = 0;
	struct Node1* temp=head->next ;
	FILE* fp = fopen("供应商数据.txt", "w+");//打开文件+清除文件内信息
	if (head != NULL)
	{
		while (temp != NULL)
		{
		
				fprintf(fp,"%s%s%s%sd%s%s%ld%s\n",temp->gysgl.ID ,temp->gysgl.Name ,temp->gysgl.jiancheng ,temp->gysgl.dizhi ,temp->gysgl.phone ,temp->gysgl.youjian ,temp->gysgl.lianxiren,temp->gysgl.telephone,temp->gysgl.beizhu );
				temp=temp->next;		
		}
		fclose(fp);//关闭文件
	}
}
void Read(struct Node1* head)//读取供应商信息 
{	int Num1=0;//录入供应商数量
	head->next = NULL;
	FILE* file = fopen("供应商数据.txt", "r");//以只读方式打开文件
	if (file == NULL)
	{
	//当文件不存在，则为真
		return;//返回上一个函数
	}
	Num1=0;//Num1为当前系统的录入供应商信息的总数，读入文件前将总数设置为0，以防有残留数据
	while (fgetc(file) != EOF) {//当下一个字符不为空时
	fseek(file, -1, 1);//每一次循环， 定位在当前行的-1位置，也就是最左边的位置
	struct Node1* temp = (struct Node1*)malloc(sizeof(struct Node1));
	int k = fscanf(file, "%s%s%s%sd%s%s%ld%s\n",temp->gysgl.ID ,temp->gysgl.Name ,temp->gysgl.jiancheng ,temp->gysgl.dizhi ,temp->gysgl.phone,temp->gysgl.youjian ,temp->gysgl.lianxiren ,temp->gysgl.telephone,temp->gysgl.beizhu  ); 
	if (k == 0)break;
	Num1++;//每一次循环，供应商信息的总数+1
	struct Node1* temp2 = head;
	while (temp2->next!= NULL)
			temp2 = temp2->next;
		temp->next = NULL;
		temp2->next = temp;
	}
	fclose(file);//关闭
}
void Input(struct Node1* head)//供应商信息输入函数
{
	int i = 0, j = 0, k = 0, flag = 0;
	int Num1=0;
	struct Node1* temp=(struct Node1*)malloc(sizeof(struct Node1));
	printf("请输入供应商编号：");
	scanf("%s",temp->gysgl.ID );
	struct Node1* temp_p = head->next ;
	if (head != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->gysgl.ID , temp->gysgl.ID ) == 0)
			{
							printf("系统已有该该供应商编号，如需添加其他供应商编号使用其它功能。");
				return;
			}
			temp_p = temp_p->next;
		}
	}
	printf("：名称：");
	scanf("%s", temp->gysgl.Name);
	printf("：简称：");
	scanf("%s", temp->gysgl.jiancheng );
	printf("：地址：");
	scanf("%s", temp->gysgl.dizhi );
	printf("公司电话：");
	scanf("%d", &temp->gysgl.phone );
	printf("：邮件");
	scanf("%s", temp->gysgl.youjian );
	printf("联系人：");
	scanf("%s",temp->gysgl.lianxiren );
	printf("联系人电话");
	scanf("%ld",&temp->gysgl.telephone);
	printf("备注：");
	scanf("%s",temp->gysgl.beizhu);
	Num1++;
	struct Node1* temp2 = head;
	while (temp2->next != NULL)
		temp2=temp2->next;
	temp->next=NULL;
	temp2->next=temp;
	printf("供应商信息录入成功，当前共有货品信息:%d。\n", Num1);
	Save(head);
}
void All(struct Node1* head)//供应商信息浏览函数
{
	int i = 0, j = 0, k = 0;
	struct Node1* temp_p = head->next;
	printf("------------------------------------------------------------------------------\n");
	printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n","序号","供应商编号", "名称", "简称", "地址", "公司电话", "邮件", "联系人","联系人电话","备注" );
	if (head != NULL)
	{
		while (temp_p != NULL)
		{
			printf("%-10d%-10s%-10s%-10s%-10s%-10d%-10s%-10s%-10ld%-10s\t\n", i+1,temp_p->gysgl.ID ,temp_p->gysgl.Name ,temp_p->gysgl.jiancheng ,temp_p->gysgl.dizhi ,temp_p->gysgl.phone,temp_p->gysgl.youjian ,temp_p->gysgl.lianxiren ,temp_p->gysgl.telephone,temp_p->gysgl.beizhu);		
			temp_p=temp_p->next ;
		}
	}
	printf("------------------------------------------------------------------------------\n");
}
void Que(struct Node1* head)//供应商信息查找函数
{
	int i = 0, j = 0, k = 0;
	struct Node1* temp = (struct Node1*)malloc(sizeof(struct Node1));
	struct Node1* temp_p = head->next ;
	printf("请输入供应商编号：");
	scanf("%s", temp->gysgl.ID );

	if (head != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->gysgl.ID , temp->gysgl.ID ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号", "供应商编号", "名称", "简称", "地址", "公司电话", "邮件","联系人","联系人电话","备注");
				printf("%-10d%-10s%-10s%-10s%-10s%-10d%-10s%-10s%-10ld%-10s\t\n", i + 1,temp_p-> gysgl.ID,temp_p->gysgl.Name ,temp_p->gysgl.jiancheng ,temp_p->gysgl.dizhi ,temp_p->gysgl.phone,temp_p->gysgl.youjian ,temp_p->gysgl.lianxiren ,temp_p->gysgl.telephone,temp_p->gysgl.beizhu);//浏览数据
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到供应商信息！\n");
		return;
	}
}
void Mod(struct Node1* head)//供应商信息修改函数
{
	int i = 0, j = 0, k = 0;
	int flag = 0;
	static char choice;
	struct Node1* temp = (struct Node1*)malloc(sizeof(struct Node1));
	struct Node1* temp_p = head->next;
	printf("请输入供应商编号：");
	scanf("%s", temp->gysgl.ID );
	if (head != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->gysgl.ID , temp->gysgl.ID ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号", "供应商编号", "名称", "简称", "地址", "公司电话", "邮件","联系人","联系人电话","备注");
				printf("%-10d%-10s%-10s%-10s%-10s%-10d%-10s%-10s%-10ld%-10s\t\n", i + 1,temp_p-> gysgl.ID,temp_p->gysgl.Name ,temp_p->gysgl.jiancheng ,temp_p->gysgl.dizhi ,temp_p->gysgl.phone,temp_p->gysgl.youjian ,temp_p->gysgl.lianxiren ,temp_p->gysgl.telephone,temp_p->gysgl.beizhu);//数据
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				printf("是否修改此数据（1/0）：");
				scanf("%d", &j);
				if (j == 1)
				{
					printf("供应商信息修改：\n");
					printf("********************************\n");
					printf("* 请择操作序号：               *\n");
					printf("* 1 修改供应商名称             *\n");
					printf("* 2 修改供应商简称             *\n");
					printf("* 3 修改供应商地址             *\n");
					printf("* 4 修改公司电话               *\n");
					printf("* 5 修改公司邮件               *\n");
					printf("* 6 修改供应商联系人           *\n");
					printf("* 7 修改供应商联系人电话       *\n");
					printf("* 8 修改供应商备注             *\n");
					printf("* 0 返回上一页                 *\n");
					printf("********************************\n");
					printf("请输入数字进入对应修改功能：");
					scanf("%d", &k);
					switch (k)//选择
					{
					case 0:
						return;//返回上一页
					case 1:
						printf("请输入供应商名称：");
						scanf("%s", temp_p->gysgl.Name );
						break;
					case 2:
						printf("请输入供应商简称：");
						scanf("%s", temp_p->gysgl.jiancheng );
					case 3:
						printf("请输入供应商地址：");
						scanf("%s", temp_p->gysgl.dizhi  );
						break;
					case 4:
						printf("请输入公司电话：");
						scanf("%d", &temp_p->gysgl.phone );
						break;
					case 5:
						printf("请输入公司邮件：");
						scanf("%s", temp_p->gysgl.youjian );
						break;
					case 6:
						printf("请输入供应商联系人：");
						scanf("%s", temp_p->gysgl.lianxiren  );
						break;
					case 7:
						printf("请输入供应商联系人电话：");
						scanf("%ld", &temp_p->gysgl.telephone );
						break;
					case 8:
						printf("请输入供应商备注：");
						scanf("%s", &temp_p->gysgl.beizhu );
						break;
					default:
						printf("输入错误， 按任意键返回上一页\n");
						return;
					}
					printf("修改成功！\n");
					return;
				}
				else {
					printf("修改取消！\n");
					return;
				}
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("没有找到供应商信息！\n");
		return;
	}
}
void Del(struct Node1* head) {//供应商信息删除函数
	int i = 0, j = 0, k = 0;
	struct Node1* temp1 = head;
	struct Node1* temp = (struct Node1*)malloc(sizeof(struct Node1));
	struct Node1* temp_p = head->next;
	printf("请输入供应商编号：");
	scanf("%s", temp->gysgl.ID );
	while (temp_p != NULL)
	{
		if (strcmp(temp_p->gysgl.ID , temp->gysgl.ID ) == 0)
		{
			printf("------------------------------------------------------------------------------\n");
			printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号", "供应商编号", "名称", "简称", "地址", "公司电话", "邮件","联系人","联系人电话","备注");
			printf("%-10d%-10s%-10s%-10s%-10s%-10d%-10s%-10s%-10ld%-10s\t\n", i + 1,temp->gysgl.ID ,temp->gysgl.Name ,temp->gysgl.jiancheng ,temp->gysgl.dizhi ,temp->gysgl.phone,temp->gysgl.youjian ,temp->gysgl.lianxiren ,temp->gysgl.telephone,temp->gysgl.beizhu);
			printf("------------------------------------------------------------------------------\n");
			printf("查找成功！\n");
			k = 1;
			printf("是否删除此数据（1/0）：");
			scanf("%d", &j);
			if (j == 1)
			{
				temp1->next = temp_p->next;
			
				printf("删除成功！\n");
			}
			else
				printf("您已取消删除操作！\n");
		}
		temp1 = temp1->next;
		temp_p = temp_p->next;
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到供应商信息！\n");
		return;
	}
}
//-------------//商品信息保存函数
void Save2(struct Node2* head2) //商品信息保存函数
{
	struct Node2* temp=head2->next ;
	int i = 0, j = 0, k = 0;
	FILE* fp = fopen("商品数据.txt", "w+");//打开文件+清除文件内信息
	if (head2 != NULL)
	{
		while (temp != NULL)
		{
		
				fprintf(fp,"%s%s%f%s%s%s\n",temp->spgl.ID ,temp->spgl.Name,&temp->spgl.danjia,temp->spgl.gysbh,temp->spgl.jianjie,temp->spgl.beizhu );
				temp=temp->next;		
		}
	}	fclose(fp);
}
void Read2(struct Node2* head2)//商品信息读取函数 
{
	head2->next  = NULL;
	FILE* file = fopen("商品数据.txt", "r");//以只读方式打开文件
	if (file == NULL)
	{
	//当文件不存在，则为真
		return;//返回上一个函数
	}
	int Num1=0;
	while (fgetc(file) != EOF) {
	//当下一个字符不为空时
	fseek(file, -1, 1);//每一次循环， 定位在当前行的-1位置，也就是最左边的位置
	struct Node2* temp = (struct Node2*)malloc(sizeof(struct Node2));
	int k = fscanf(file, "%s%s%f%s%s%s\n",temp->spgl.ID ,temp->spgl.Name,&temp->spgl.danjia,temp->spgl.gysbh,temp->spgl.jianjie,temp->spgl.beizhu ); 
	if (k == 0)break;
	Num1++;//每一次循环，供应商信息的总数 + 1
	struct Node2* temp2 = head2;
	while (temp2->next != NULL)
			temp2 = temp2->next;
		temp->next = NULL;
		temp2->next = temp;
	}
	fclose(file);//关闭
}
void Input2(struct Node2* head2)//商品信息输入函数
{
	int i = 0, j = 0, k = 0, flag = 0;
	struct Node2* temp = (struct Node2*)malloc(sizeof(struct Node2));
	printf("请输入商品编号：");
	scanf("%s",temp->spgl.ID );
	struct Node2* temp_p = head2->next;
	if (head2 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->spgl.ID  , temp->spgl.ID ) == 0)
			{
							printf("系统已有商品编号，如需添加其他商品信息使用其它功能。");
				return;
			}
			temp_p = temp_p->next;
		}
	}
	printf("名称:");
	scanf("%s",temp->spgl.Name );
	printf("单价：");
	scanf("%f", &temp->spgl.danjia );
	printf("供应商编号：");
	scanf("%s", temp->spgl.gysbh );
	printf("简介：");
	scanf("%s", temp->spgl.jianjie );
	printf("备注：");
	scanf("%s", &temp->spgl.beizhu );
	temp = 0;
	struct Node2* temp2 = head2;
	while (temp2->next != NULL)
		temp2 = temp2->next;
	temp->next = NULL;
	temp2->next = temp;
	Save2(head2);
}
void All2(struct Node2* head2) //商品信息浏览函数
{
	//商品信息浏览函数
	int i = 0, j = 0, k = 0;
	struct Node2* temp_p = head2->next;
	printf("------------------------------------------------------------------------------\n");
	printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n","序号" "商品编号", "名称", "单价", "供应商编号", "简介", "备注");
	if (head2 != NULL)
	{
		while (temp_p != NULL)
		{
			printf("%-10d%-10s%-10s%-10f%-10s%-10s%-10s\t\n", i + 1, temp_p->spgl.ID ,temp_p->spgl.Name,temp_p->spgl.danjia,temp_p->spgl.gysbh ,temp_p->spgl.jianjie ,temp_p->spgl.beizhu );//浏览数据
			temp_p = temp_p->next;
		}
	}
	printf("------------------------------------------------------------------------------\n");
}
void Que2(struct Node2* head2)//商品信息查找函数
{
	int i = 0, j = 0, k = 0;
	struct Node2* temp = (struct Node2*)malloc(sizeof(struct Node2));
	struct Node2* temp_p = head2->next ;
	printf("请输入商品编号：");
	scanf("%s", temp->spgl.ID );

	if (head2 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->spgl.ID , temp->spgl.ID ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","商品编号", "名称", "单价", "供应商编号", "简介", "备注");
				printf("%-10d%-10s%-10s%-10f%-10s%-10s%-10s\t\n",  i + 1, temp_p->spgl.ID ,temp_p->spgl.Name,temp_p->spgl.danjia,temp_p->spgl.gysbh ,temp_p->spgl.jianjie ,temp_p->spgl.beizhu);//浏览数据
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到商品信息！\n");
		return;
	}
}
void Mod2(struct Node2* head2)//商品信息修改函数
{
	int i = 0, j = 0, k = 0;
	int flag = 0;
	static char choice;
	struct Node2* temp = (struct Node2*)malloc(sizeof(struct Node2));
	struct Node2* temp_p = head2->next;
	printf("请输入商品编号：");
	scanf("%s", temp->spgl.ID);
	if (head2 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->spgl.ID , temp->spgl.ID ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","商品编号", "名称", "单价", "供应商编号", "简介", "备注");
				printf("%-10d%-10s%-10s%-10f%-10s%-10s%-10s\t\n",  i + 1, temp_p->spgl.ID ,temp_p->spgl.Name,temp_p->spgl.danjia,temp_p->spgl.gysbh ,temp_p->spgl.jianjie ,temp_p->spgl.beizhu);
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				printf("是否修改此数据（1/0）：");
				scanf("%d", &j);
				if (j == 1)
				{
					printf("商品信息修改：\n");
					printf("********************************\n");
					printf("* 请择操作序号：               *\n");
					printf("* 1 修改商品编号               *\n");
					printf("* 2 修改商品名称               *\n");
					printf("* 3 修改商品单价               *\n");
					printf("* 4 修改供应商编号             *\n");
					printf("* 5 修改商品简介               *\n");
					printf("* 6 修改商品备注               *\n");
					printf("* 0 返回上一页                 *\n");
					printf("********************************\n");
					printf("请输入数字进入对应修改功能：");
					scanf("%d", &k);
					switch (k)//选择
					{
					case 0:
						return;//返回上一页
					case 1:
						printf("请输入编号：");
						scanf("%s", temp_p->spgl.ID );
						break;
					case 2:
						printf("请输入名称：");
						scanf("%s", temp_p->spgl.Name );
					case 3:
						printf("请输入单价：");
						scanf("%f", &temp_p->spgl.danjia );
						break;
					case 4:
						printf("请输入供应商编号：");
						scanf("%s", temp_p->spgl.gysbh );
						break;
					case 5:
						printf("请输入简介：");
						scanf("%s", temp_p->spgl.jianjie );
						break;
					case 6:
						printf("请输入备注：");
						scanf("%s", &temp_p->spgl.beizhu );
						break;
					default:
						printf("输入错误， 按任意键返回上一页\n");
						return;
					}
					printf("修改成功！\n");
					return;
				}
				else {
					printf("修改取消！\n");
					return;
				}
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("没有找到商品信息！\n");
		return;
	}
}
void Del2(struct Node2* head2)//商品信息删除函数
{
	int i = 0, j = 0, k = 0;
	struct Node2* temp1 = head2;
	struct Node2* temp = (struct Node2*)malloc(sizeof(struct Node2));
	struct Node2* temp_p = head2->next;
	printf("请输入商品编号：");
	scanf("%s", temp->spgl.ID );
	while (temp_p != NULL)
	{
		if (strcmp(temp_p->spgl.ID , temp->spgl.ID ) == 0)
		{
			printf("------------------------------------------------------------------------------\n");
			printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","商品编号", "名称", "单价", "供应商编号", "简介", "备注");
			printf("%-10d%-10s%-10s%-10f%-10s%-10s%-10s\t\n",  i + 1, temp_p->spgl.ID ,temp_p->spgl.Name,temp_p->spgl.danjia,temp_p->spgl.gysbh ,temp_p->spgl.jianjie ,temp_p->spgl.beizhu);
			printf("------------------------------------------------------------------------------\n");
			printf("查找成功！\n");
			k = 1;
			printf("是否删除此数据（1/0）：");
			scanf("%d", &j);
			if (j == 1)
			{
				temp1->next = temp_p->next;
				printf("删除成功！\n");
			}
			else
				printf("您已取消删除操作！\n");
		}
		temp1 = temp1->next;
		temp_p = temp_p->next;
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到商品信息！\n");
		return;
	}
}
void Save3(struct Node3* head3) //员工信息保存函数
{
	struct Node3* temp=head3->next ;
	int i = 0, j = 0, k = 0;
	FILE* fp = fopen("员工数据.txt", "w+");//打开文件+清除文件内信息
	if (head3 != NULL)
	{
		while (temp != NULL)
		{
		
				fprintf(fp,"%s%s%s%s%ld%f%s\n",temp->yggl.ID ,temp->yggl.Name,temp->yggl.Mima,temp->yggl.jibie,&temp->yggl.phone,&temp->yggl.gongzi,temp->yggl.beizhu   );
				temp=temp->next;		
		}
	}	fclose(fp);
}
void Read3(struct Node3* head3)//员工信息读取函数
{
	head3->next = NULL;
	FILE* file = fopen("员工数据.txt", "r");//以只读方式打开文件
	if (file == NULL)
	{
	//当文件不存在，则为真
		return;//返回上一个函数
	}
	while (fgetc(file) != EOF)
	{
	//当下一个字符不为空时
	fseek(file, -1, 1);//每一次循环， 定位在当前行的-1位置，也就是最左边的位置
	struct Node3* temp = (struct Node3*)malloc(sizeof(struct Node3));
	int k = fscanf(file,"%s%s%s%s%ld%f%s\n",temp->yggl.ID ,temp->yggl.Name,temp->yggl.Mima,temp->yggl.jibie,temp->yggl.phone,temp->yggl.gongzi,temp->yggl.beizhu); 
	if (k == 0)
	break;
	struct Node3* temp2 = head3;
	while (temp2->next != NULL)
			temp2 = temp2->next;
		temp->next = NULL;
		temp2->next = temp;
	}
	fclose(file);//关闭
}
void Input3(struct Node3* head3)//员工信息输入函数 
{
	int i = 0, j = 0, k = 0, flag = 0;//flag用来输入员工编号， j用来遍历输出查找员工编号是否重复
	struct Node3* temp = (struct Node3*)malloc(sizeof(struct Node3));
	printf("请输入员工编号：");
	scanf("%s", temp->yggl.ID );
	struct Node3* temp_p = head3->next;
	if (head3 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->yggl.ID , temp->yggl.ID ) == 0)
			{
				printf("系统已有该员工编号，编号不可重复！");
				return;
			}
			temp_p = temp_p->next;
		}
	}
	printf("姓名：");
	scanf("%s", temp->yggl.Name);
	printf("密码：");
	scanf("%s", temp->yggl.Mima);
	printf("级别：");
	scanf("%s", &temp->yggl.jibie);
	printf("电话：");
	scanf("%ld", &temp->yggl.phone);
	printf("工资：");
	scanf("%f", temp->yggl.gongzi);
	printf("备注：");
	scanf("%s", temp->yggl.beizhu);
	struct Node3* temp2 = head3;
	while (temp2->next!=NULL)
		temp2=temp2->next;
	temp->next=NULL;
	temp2->next=temp;
}
void All3(struct Node3* head3)//员工信息浏览函数
{
//用户信息浏览函数
	int i = 0, j = 0, k = 0;
	struct Node3* temp_p = head3->next ;
	printf("------------------------------------------------------------------------------\n");
	printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "员工编号", "姓名", "密码", "级别", "电话", "工资", "备注");
	if (head3 != NULL)
	{
		while (temp_p != NULL)
		{
			printf("%-10d%-10s%-10s%-10s%-10s%-10ld%-10.2f%-10s\t\n", i + 1,temp_p->yggl.ID,temp_p->yggl.Name,temp_p->yggl.Mima,temp_p->yggl.jibie,temp_p->yggl.phone,temp_p->yggl.gongzi,temp_p->yggl.beizhu );//浏览数据
			temp_p = temp_p->next;
		}
	}
	printf("------------------------------------------------------------------------------\n");
}
void Que3(struct Node3* head3)//员工信息查找函数
{
	int i = 0, j = 0, k = 0;
	struct Node3* temp = (struct Node3*)malloc(sizeof(struct Node3));
	struct Node3* temp_p = head3->next ;
	printf("请输入员工编号：");
	scanf("%s", temp->yggl.ID );

	if (head3 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->yggl.ID , temp->yggl.ID ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n","员工编号", "姓名", "密码", "级别", "电话", "工资", "备注");
				printf("%-10d%-10s%-10s%-10s%-10s%-10ld%-10.2f%-10s\t\n", i + 1,temp->yggl.ID ,temp->yggl.Name,temp->yggl.Mima,temp->yggl.jibie,temp->yggl.phone,temp->yggl.gongzi,temp->yggl.beizhu );//浏览数据
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到用户信息！\n");
		return;
	}
}
void Mod3(struct Node3* head3)//员工信息修改函数
{
 //用户信息修改函数
	int i = 0, j = 0, k = 0;
	int flag = 0;
	static char choice;
	struct Node3* temp = (struct Node3*)malloc(sizeof(struct Node3));
	struct Node3* temp_p = head3->next;
	printf("请输入用户编号：");
	scanf("%s", temp->yggl.ID );
	if (head3 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->yggl.ID , temp->yggl.ID ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n","员工编号", "姓名", "密码", "级别", "电话", "工资", "备注");
				printf("%-10d%-10s%-10s%-10s%-10s%-10ld%-10.2f%-10s\t\n", i + 1,temp->yggl.ID ,temp->yggl.Name,temp->yggl.Mima,temp->yggl.jibie,temp->yggl.phone,temp->yggl.gongzi,temp->yggl.beizhu );//浏览数据
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				printf("是否修改此数据（1/0）：");
				scanf("%d", &j);
				if (j == 1)
				{
					printf("员工信息修改：\n");
					printf("********************************\n");
					printf("* 请择操作序号：               *\n");
					printf("* 1 修改员工姓名               *\n");
					printf("* 2 修改员工密码               *\n");
					printf("* 3 修改员工级别               *\n");
					printf("* 4 修改员工电话               *\n");
					printf("* 5 修改员工工资               *\n");
					printf("* 6 修改员工备注               *\n");
					printf("* 0 返回上一页                 *\n");
					printf("********************************\n");
					printf("请输入数字进入对应修改功能：");
					scanf("%d", &k);
					switch (k)//选择
					{
					case 0:
						return;//返回上一页
					case 1:
						printf("请输入姓名：");
						scanf("%s", temp_p->yggl.Name);
						break;
					case 2:
						printf("请输入密码：");
						scanf("%s", temp_p->yggl.Mima );
					case 3:
						printf("请输入员工级别：");
						scanf("%s", &temp_p->yggl.jibie );
						break;
					case 4:
						printf("请输入员工电话：");
						scanf("%ld", &temp_p->yggl.phone );
						break;
					case 5:
						printf("请输入员工工资：");
						scanf("%f", temp_p->yggl.gongzi );
						break;
					case 6:
						printf("请输入员工备注：");
						scanf("%s", temp_p->yggl.beizhu );
						break;
					default:
						printf("输入错误， 按任意键返回上一页\n");
						return;
					}
					printf("修改成功！\n");
					return;
				}
				else {
					printf("修改取消！\n");
					return;
				}
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("没有找到用户信息！\n");
		return;
	}
}
void Del3(struct Node3* head3) //员工信息删除函数
{
	int i = 0, j = 0, k = 0;
	struct Node3* temp1 = head3;
	struct Node3* temp = (struct Node3*)malloc(sizeof(struct Node3));
	struct Node3* temp_p = head3->next;
	printf("请输入员工编号：");
	scanf("%s", temp->yggl.ID );
	while (temp_p != NULL)
	{
		if (strcmp(temp_p->yggl.ID , temp->yggl.ID ) == 0)
		{
			printf("------------------------------------------------------------------------------\n");
			printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n","员工编号", "姓名", "密码", "级别", "电话", "工资", "备注");
			printf("%-10d%-10s%-10s%-10s%-10s%-10ld%-10.2f%-10s\t\n", i + 1,temp->yggl.ID ,temp->yggl.Name,temp->yggl.Mima,temp->yggl.jibie,temp->yggl.phone,temp->yggl.gongzi,temp->yggl.beizhu );//浏览数据
			printf("------------------------------------------------------------------------------\n");
			printf("查找成功！\n");
			k = 1;
			printf("是否删除此数据（1/0）：");
			scanf("%d", &j);
			if (j == 1)
			{
				temp1->next = temp_p->next;
				printf("删除成功！\n");
			}
			else
				printf("您已取消删除操作！\n");
		}
		temp1 = temp1->next;
		temp_p = temp_p->next;
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到用户信息！\n");
		return;
	}
}
void Save4(struct Node4* head4)//采购信息保存函数
{
	int i = 0, j = 0, k = 0;
	struct Node4* temp = head4->next;
	FILE* fp = fopen("采购数据.txt", "w+");//打开文件+清除文件内信息
	if (head4 != NULL)
	{
		while (temp != NULL)
		{
			fprintf(fp, "%s %s %d %.2f%s\n", temp->cggl.cgqdh , temp->cggl.ygbm , temp->cggl.shuliang , temp->cggl.zongjia, temp->cggl.time );
			temp = temp->next;
		}
	}
	fclose(fp);//关闭文件
}
void Read4(struct Node4* head4) //采购信息读取函数
{
//采购信息读取函数
	head4->next = NULL;
	FILE* file = fopen("采购数据.txt", "r");//以只读方式打开文件
	if (file == NULL) {//当文件不存在，则为真
		return;//返回上一个函数
	}
	while (fgetc(file) != EOF) {//当下一个字符不为空时
		fseek(file, -1, 1);//每一次循环， 定位在当前行的-1位置，也就是最左边的位置
		struct Node4* temp = (struct Node4*)malloc(sizeof(struct Node4));
		int k = fscanf(file, "%s %s %d %.2f%s\n",temp->cggl.cgqdh , temp->cggl.ygbm , temp->cggl.shuliang , temp->cggl.zongjia, temp->cggl.time );
		if (k == 0)break;
		struct Node4* temp2 = head4;
		while (temp2->next != NULL)
			temp2 = temp2->next;
		temp->next = NULL;
		temp2->next = temp;
	}
	fclose(file);//关闭
}
void Input4(struct Node4* head4)//采购信息输入函数 
{
	int i = 0, j = 0, k = 0, flag = 0;
	struct Node4* temp = (struct Node4*)malloc(sizeof(struct Node4));
	printf("请输入采购清单号：");
	scanf("%s", temp->cggl.cgqdh );
	struct Node4* temp_p = head4->next ;
	if (head4 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->cggl.cgqdh, temp->cggl.cgqdh ) == 0)
			{
				printf("系统已有该采购数据，如需进货请使用其它功能。");
				return;
			}
			temp_p = temp_p->next;
		}
	}
	printf("员工编码:");
	scanf("%s", temp->cggl.ygbm);
	printf("采购数量：");
	scanf("%d", &temp->cggl.shuliang);
	printf("采购总价：");
	scanf("%f", &temp->cggl.zongjia);
	printf("采购时间：");
	scanf("%s", temp->cggl.time);
	printf("备注：");
	scanf("%s",temp->cggl.beizhu );
	struct Node4* temp2=head4;
	while (temp2->next != NULL)
		temp2 = temp2->next;
	temp->next = NULL;
	temp2->next = temp;
}
void All4(struct Node4* head4)//采购信息浏览函数
{
//采购信息浏览函数
	int i = 0, j = 0, k = 0;
	struct Node4* temp_p = head4->next ;
	printf("------------------------------------------------------------------------------\n");
	printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","采购清单号", "员工编码", "采购数量", "采购总价", "采购时间", "备注");
	if (head4 != NULL)
	{
		while (temp_p != NULL)
		{
			
			printf("%-10d%-10s%-10s%-10d%-10f%-10s%-10s\t\n",  i + 1,temp_p->cggl.cgqdh,temp_p->cggl.ygbm,temp_p->cggl.shuliang,temp_p->cggl.zongjia,temp_p->cggl.time ,temp_p->cggl.beizhu);
			temp_p = temp_p->next;
		}
	}
	printf("------------------------------------------------------------------------------\n");
}
void Que4(struct Node4* head4)//采购信息查找函数
{
	int i = 0, j = 0, k = 0;
	struct Node4* temp = (struct Node4*)malloc(sizeof(struct Node4));
	struct Node4* temp_p = head4->next  ;
	printf("请输入采购清单号：");
	scanf("%s", temp->cggl.cgqdh  );

	if (head4 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->cggl.cgqdh , temp->cggl.cgqdh ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","采购清单号", "员工编码", "采购数量", "采购总价", "采购时间", "备注");
				printf("%-10d%-10s%-10s%-10d%-10f%-10s%-10s\t\n",  i + 1,temp->cggl.cgqdh,temp->cggl.ygbm,temp->cggl.shuliang,temp->cggl.zongjia,temp->cggl.time ,temp->cggl.beizhu);//浏览数据
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到采购信息！\n");
		return;
	}
}
void Mod4(struct Node4* head4)//采购信息修改函数
{
	int i = 0, j = 0, k = 0;
	int flag = 0;
	static char choice;
	struct Node4* temp = (struct Node4*)malloc(sizeof(struct Node4));
	struct Node4* temp_p = head4->next;
	printf("请输入采购清单号：");
	scanf("%s",temp->cggl.cgqdh  );
	if (head4 != NULL)
	{
		while (temp_p != NULL)
		{
			if (strcmp(temp_p->cggl.cgqdh , temp->cggl.cgqdh ) == 0)
			{
				printf("------------------------------------------------------------------------------\n");
				printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","采购清单号", "员工编码", "采购数量", "采购总价", "采购时间", "备注");
				printf("%-10d%-10s%-10s%-10d%-10f%-10s%-10s\t\n",  i + 1,temp->cggl.cgqdh,temp->cggl.ygbm,temp->cggl.shuliang,temp->cggl.zongjia,temp->cggl.time ,temp->cggl.beizhu);
				printf("------------------------------------------------------------------------------\n");
				printf("查找成功！\n");
				printf("是否修改此数据（1/0）：");
				scanf("%d", &j);
				if (j == 1)
				{
					printf("商品信息修改：\n");
					printf("********************************\n");
					printf("* 请择操作序号：               *\n");
					printf("* 1 修改员工编码               *\n");
					printf("* 2 修改采购数量               *\n");
					printf("* 3 修改采购总价               *\n");
					printf("* 4 修改采购时间               *\n");
					printf("* 5 修改采购备注               *\n");
					printf("* 0 返回上一页                 *\n");
					printf("********************************\n");
					printf("请输入数字进入对应修改功能：");
					scanf("%d", &k);
					switch (k)//选择
					{
					case 0:
						return;//返回上一页
					case 1:
						printf("请输入员工编号：");
						scanf("%s", temp_p->cggl.ygbm);
						break;
					case 2:
						printf("请输入采购数量：");
						scanf("%d", &temp_p->cggl.shuliang );
					case 3:
						printf("请输入采购总价：");
						scanf("%f", &temp_p->cggl.zongjia);
						break;
					case 4:
						printf("请输入采购时间：");
						scanf("%s", temp_p->cggl.time);
						break;
					case 5:
						printf("请输入备注：");
						scanf("%s", temp_p->cggl.beizhu);
						break;
					default:
						printf("输入错误， 按任意键返回上一页\n");
						return;
					}
					printf("修改成功！\n");
					return;
				}
				else {
					printf("修改取消！\n");
					return;
				}
				k = 1;
			}
			temp_p = temp_p->next;
		}
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("没有找到采购信息！\n");
		return;
	}
}
void Del4(struct Node4* head4)//采购信息删除函数
{
	int i = 0, j = 0, k = 0;
	struct Node4* temp1 = head4;
	struct Node4* temp = (struct Node4*)malloc(sizeof(struct Node4));
	struct Node4* temp_p = head4->next;
	printf("请输入采购编号：");
	scanf("%s", temp->cggl.cgqdh);
	while (temp_p != NULL)
	{
		if (strcmp(temp_p->cggl.cgqdh , temp->cggl.cgqdh  ) == 0)
		{
			printf("------------------------------------------------------------------------------\n");
			printf("%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "序号","采购清单号", "员工编码", "采购数量", "采购总价", "采购时间", "备注");
			printf("%-10d%-10s%-10s%-10d%-10f%-10s%-10s\t\n",  i + 1,temp->cggl.cgqdh,temp->cggl.ygbm,temp->cggl.shuliang,temp->cggl.zongjia,temp->cggl.time ,temp->cggl.beizhu);
			printf("------------------------------------------------------------------------------\n");
			printf("查找成功！\n");
			k = 1;
			printf("是否删除此数据（1/0）：");
			scanf("%d", &j);
			if (j == 1)
			{
				temp1->next = temp_p->next;
				printf("删除成功！\n");
			}
			else
				printf("您已取消删除操作！\n");
		}
		temp1 = temp1->next;
		temp_p = temp_p->next;
	}
	if (k == 0) {//没有找到数据则给出提示
		printf("未找到采购信息！\n");
		return;
	}
}